home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6310 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.lpr.carel.fi!usenet
  2. From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: default argument problem on rs6000
  5. Date: Thu, 08 Feb 1996 12:37:12 +0200
  6. Organization: Carelcomp Forest
  7. Message-ID: <3119D258.79F6@cmt.lpr.mail.carel.fi>
  8. References: <4faan9$1rp@fsuj01.rz.uni-jena.de>
  9. NNTP-Posting-Host: renoir.cclahti.carel.fi
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6a (WinNT; I)
  14.  
  15. Tilo Koerbs wrote:
  16. > When compiling the following code on an rs6000 (ibm) I get an error:
  17. >         struct X {
  18. >                static int f() throw();
  19. >               X(int i = f());
  20. >         };
  21. >         inline int X::f() { return 0; }
  22. > Error message:  "X::f()" was declared with external linkage
  23. >                 and called before it is defined as inline.
  24. > No other compiler reports an error.
  25. > And I cannot find a constructor call in that code nor can I believe
  26. > that the declaration of the destructor will evaluate f() .
  27. > Any comments?
  28.  
  29. Maybe you mean something like this (?):
  30.  
  31.     struct X {
  32.         int y;
  33.         static int f();
  34.         X(int i = f()) { y = i; }
  35.     };
  36.  
  37.     inline int    X::f() { return 1; }
  38.  
  39. Later,
  40.  AriL
  41. -- 
  42. All my opinions are mine and mine alone.
  43.